﻿using Compass.Wasm.Shared.Categories;
using Compass.Wasm.Shared.Wms;

namespace Compass.Wpf.Converters;

/// <summary>
/// WPF中，枚举与字符串的相互转换
/// </summary>
/// <typeparam name="T"></typeparam>
public class EnumConverter<T> : IValueConverter where T : Enum
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return value.ToString();
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return (T)Enum.Parse(typeof(T), value.ToString());
    }
}

public class ProductConverter : EnumConverter<Product_e> { }
public class UnitConverter : EnumConverter<Unit_e>{}
public class SbuConverter : EnumConverter<Sbu_e>{}
public class WarehouseLocationConverter : EnumConverter<WarehouseLocation_e> {}




public class SidePanelConverter : EnumConverter<SidePanel_e> { }
public class LightTypeConverter : EnumConverter<LightType_e> { }

public class DrainTypeConverter : EnumConverter<DrainType_e> { }
public class WaterInletConverter : EnumConverter<WaterInlet_e> { }

public class AnsulSideConverter : EnumConverter<AnsulSide_e> { }
public class AnsulDetectorConverter : EnumConverter<AnsulDetector_e> { }
public class AnsulDetectorEndConverter : EnumConverter<AnsulDetectorEnd_e> { }

public class UvLightTypeConverter : EnumConverter<UvLightType_e> { }


public class FilterTypeConverter:EnumConverter<FilterType_e>{}
public class FilterSideConverter : EnumConverter<FilterSide_e> {}

public class CeilingLightTypeConverter : EnumConverter<CeilingLightType_e> { }
public class LightCableConverter : EnumConverter<LightCable_e> { }
public class HclSideConverter : EnumConverter<HclSide_e> { }


public class CeilingWaterInletConverter : EnumConverter<CeilingWaterInlet_e> { }

public class CjSpigotDirectionConverter:EnumConverter<CjSpigotDirection_e>{}
public class BeamTypeConverter:EnumConverter<BeamType_e>{}
public class BcjSideConverter:EnumConverter<BcjSide_e>{}
public class LksSideConverter:EnumConverter<LksSide_e>{}
public class GutterSideConverter:EnumConverter<GutterSide_e>{}

public class NocjSideConverter:EnumConverter<NocjSide_e>{}
public class NocjBackSideConverter : EnumConverter<NocjBackSide_e>{}
public class DpSideConverter : EnumConverter<DpSide_e> { }
public class DpBackSideConverter : EnumConverter<DpBackSide_e> { }

public class DpDrainTypeConverter : EnumConverter<DpDrainType_e> { }
public class PanelTypeConverter:EnumConverter<PanelType_e>{}

public class ExportWayConverter : EnumConverter<ExportWay_e> { }
public class AccTypeConverter : EnumConverter<AccType_e> { }

public class DrawingTypeConverter:EnumConverter<DrawingType_e>{}

public class WarehouseConverter : EnumConverter<Warehouse_e> { }
public class AreaConverter : EnumConverter<Area_e> { }
public class GroupConverter : EnumConverter<Group_e> { }
public class OrderingWayConverter : EnumConverter<OrderingWay_e> { }

public class StationConverter:EnumConverter<Station_e>{}
